package com.keensense.vcm.model;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 * 时空碰撞、时空频次分析请求
 * 
 * @author lanjian
 * @date 2020/5/22 10:13 上午
 */
@XmlRootElement(name = "request")
public class SpatiotemporalRequest {
    private SpatiotemporalRequest() {}

    public SpatiotemporalRequest(int minFrequence, Library libraryA) {
        this.minFrequence = minFrequence;
        this.libraryA = libraryA;
    }

    /**
     * 最小频度，统计超过此频度及以上的过脸数据，最小频度可以设置为2
     * <p>
     * M int
     * </p>
     */
    @XmlElement
    private int minFrequence;
    /**
     * 返回按频度排序的前topN档案，范围[1,100]
     * <p>
     * O int
     * </p>
     */
    @XmlElement
    private Integer topN;

    /**
     * 人脸算法，单算法时默认取该算法，多算法时默认取第一个算法
     * <P>
     * O string
     * </P>
     */
    @XmlElement
    private String algorithmCode;

    /**
     * 超时时间，单位为秒，默认30s。最小值可以设置为3s，最大值可以设置为1200s。
     * <P>
     * O string
     * </P>
     */
    @XmlElement
    private Integer timeout;

    @XmlElement
    private Library libraryA;

    @XmlElement
    private Library libraryB;

    @XmlTransient
    public int getMinFrequence() {
        return minFrequence;
    }

    public void setMinFrequence(int minFrequence) {
        this.minFrequence = minFrequence;
    }

    @XmlTransient
    public Integer getTopN() {
        return topN;
    }

    public void setTopN(Integer topN) {
        this.topN = topN;
    }

    @XmlTransient
    public String getAlgorithmCode() {
        return algorithmCode;
    }

    public void setAlgorithmCode(String algorithmCode) {
        this.algorithmCode = algorithmCode;
    }

    @XmlTransient
    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    @XmlTransient
    public Library getLibraryA() {
        return libraryA;
    }

    public void setLibraryA(Library libraryA) {
        this.libraryA = libraryA;
    }

    @XmlTransient
    public Library getLibraryB() {
        return libraryB;
    }

    public void setLibraryB(Library libraryB) {
        this.libraryB = libraryB;
    }

    public static class Library {

        @XmlElementWrapper(name = "faceGroups")
        @XmlElement(name = "faceGroup")
        private List<FaceGroup> faceGroups;

        @XmlTransient
        public List<FaceGroup> getFaceGroups() {
            return faceGroups;
        }

        public void setFaceGroups(List<FaceGroup> faceGroups) {
            this.faceGroups = faceGroups;
        }
    }

}
